<TABLE WIDTH="800" BORDER="0" CELLSPACING="0" CELLPADDING="0" ID="Table1">
	<TR>
		<TD class="N-TopLineBG">
			<img src="<%#VirtualDirectory%>/images/spacer.gif" width="10" height="10">
		</TD>
	</TR>
	<TR align="left">
		<TD HEIGHT="40" BACKGROUND="<%#VirtualDirectory%>/images/HEADBG.GIF" Class="N-LogoBG" align="left">
			<table width="790" height="35" border="0" align="center" cellpadding="0" cellspacing="0" ID="Table2">
				<TR>
					<td width="180" align="left"><img src="<%#VirtualDirectory%>/images/skeltaworkflowlogo.gif"></td>
					<td width="570"><div align="right" class="heading1">Report</div>
					</td>
				</TR>
			</table>
		</TD>
	</TR>
	<TR>
		<TD>
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table3">
				<TR Class="N-MainBGColor">
					<TD colspan="5" class="heading2">
						<B>Report View - Report Filter:
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2"><IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="5"></TD>
	</TR>
	<TR>
		<TD>
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table4">
				<TR CLASS="N-TopRowBG">
					<!--Loaded from ReportMasterLevelApplication.htm-->
					<%#application%>
					<input type="hidden" name="application" value="<%#applicationhiddenname%>" ID="Hidden2">
					<!--Loaded from ReportMasterLevelWorkflow.htm-->
					<input type="hidden" name="workflow" value="<%#workflowhiddenname%>" ID="Hidden1">
					<%#workflow%>
					<input type="hidden" name="multipleworkflows" value="">
					<input type="hidden" name="reporttype" value="<%#reporttypehiddenname%>">
					<!--Loaded from ReportMasterLevelReportType.htm-->
					<%#reporttypevalue%>
					<input type="hidden" name="datecorrectionfactor" value="">
					<input type="hidden" name="display" value="">
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2"><IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="5"></TD>
	</TR>
	<TR class="N-TopRowBG">
		<TD colspan="5" class="runtext2" align="right">
			<A HREF="#" onclick="javascript:validate()"><B>Proceed >> </B></A>
		</TD>
	</TR>
	<TR>
		<TD bgcolor="#d4d0c8"><IMG SRC="<%#VirtualDirectory%>/images/spacer.gif" WIDTH="10" HEIGHT="10"></TD>
	</TR>
</TABLE>
<SCRIPT>
			//Dynamic drop downs
			var WorkflowsArray = new Array();
			function Workflows(ApplicationName, WorkflowName,WorkflowValue)
			{
				rExp = /@!@#/g
				ramp= /&amp;/g
				rlt= /&lt;/g
				rgt= /&gt;/g
				rquot=/&quot;/g
				this.ApplicationName = ApplicationName;
				this.WorkflowName = WorkflowName.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">")
				this.WorkflowValue = WorkflowValue.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">");
			}
		function listWorkflows(Application,Workflow)
		{
			if(typeof(Application) != 'undefined')
			{
				document.getElementsByTagName("input")["application"].value = Application;
				closeChild();
				Workflowscount = document.getElementsByTagName("select")["selworkflow"].length ;
				for(opt=0;opt<= Workflowscount; opt++)
					{
						document.getElementsByTagName("select")["selworkflow"].options[0]=null;
					}
				if (Application != "" && typeof(Application) != 'undefined')
					{
						obj = document.getElementsByTagName("select")["selworkflow"];
						for (i=0;i<WorkflowsArray.length;i++)
							{
								if ( WorkflowsArray[i].ApplicationName == Application)
									{
										f = new Option(WorkflowsArray[i].WorkflowName,WorkflowsArray[i].WorkflowValue,0,0);
										opcount = document.getElementsByTagName("select")["selworkflow"].length ;
										eval("obj.options["+opcount+"]=f");
										if( Workflow == WorkflowsArray[i].WorkflowName)
										{
											eval("obj.options["+opcount+"].selected=true");
										}
									}
							}
							//set the value of selected workflow
							SelectValue(document.getElementsByTagName("select")["selworkflow"].value)
					}

				}
		}
		// Be sure to set this globally...
		 var isOpened = false;
		 var win_child = 0;
		 function closeChild()
		 {
		    if (isOpened)
		          if (!win_child.closed)
		          {
		               win_child.close();

		          }
		}



		function validate()
		{

			if(document.getElementsByTagName("input")["workflow"].value == "Multiple" || document.getElementsByTagName("input")["workflow"].value =="" || document.getElementsByTagName("input")["workflow"].value =="-1")
			{
				alert('Could not process your request,please enter valid details.')
				return false;
			}
			if(document.getElementsByTagName("select")["selreporttype"].value == 0)
			{
				alert('Please select report type.')
				return false;
			}
			if(isOpened)
			{
				closeChild();
			}
			var WfValues="" ;
			WfValues =  document.getElementsByTagName("input")["workflow"].value;

			var Urlval="";
			Urlval = location.href;
			if(location.href.indexOf("=merge") > 0 )
			{
				//Urlval = Urlval.substring(0,Urlval.indexOf("?"))	+ "?display=merge&application="+ document.getElementsByTagName("input")["application"].value +"&reporttype="+ document.getElementsByTagName("select")["selreporttype"].value +"&workflow="+ WfValues +"&datecorrectionfactor="+ GetUTCOffSet();
				//Urlval = Urlval.substring(0,Urlval.indexOf("?"))	+ "?display=merge";
				document.getElementsByTagName("input")["display"].value = "merge";
			}
			else
			{
				document.getElementsByTagName("input")["display"].value = "querybuilder";
				//Urlval = Urlval.substring(0,Urlval.indexOf("?")) + "?display=querybuilder&application="+ document.getElementsByTagName("input")["application"].value +"&reporttype="+ document.getElementsByTagName("select")["selreporttype"].value +"&workflow="+ WfValues +"&datecorrectionfactor="+ GetUTCOffSet();
			}
			//Urlval = Urlval.replace("#","");
			//location.href = Urlval
			document.forms[0].submit();
		}
		function SelectValue(value)
		{
			//alert(value)
			document.getElementsByTagName("input")["workflow"].value = value;
		}

		function SetReportType(value)
		{
			//alert(value)
			document.getElementsByTagName("input")["reporttype"].value = value;
		}

		function SetWorkflows(value)
		{
			document.getElementsByTagName("input")["workflow"].value = value;
			closeChild();
			if(value == "Multiple")
			{
				win_child = window.open("?display=multipleworkflows&applicationname="+ document.getElementsByTagName("input")["application"].value,"SelectMultipleWorkflows","height=250,width=300,resizable=yes,scrollbars=yes")
				win_child.opener = self;
				isOpened = true;
		    }

		}
		document.getElementsByTagName("input")["datecorrectionfactor"].value = GetUTCOffSet();
		//scriptarray
		<%#applicationworkflowarray%>
		//alert(document.getElementsByTagName("input")["application"].value);
</script>
